<template>
	<!-- 首页 -->
	<view>
		<u-navbar
			title="健康码(学习交流)" 
			leftIcon="" fixed
		>
		</u-navbar>
		<div class="content">
			<div>
				<div class="title" style="letter-spacing: 20rpx;">健康码(学习交流)</div>
				<div class="title">xxx领导小组</div>
				<div class="sub-title">要求使用"健康码"小程序</div>
				<div class="icon-box flex-column">
					<u--image style="margin: 0 auto;;" src="/static/logo.png" width="120px" height="120px" ></u--image>
					<div>
						<text style="color: #136191;font-weight: bold;">扫码抗疫情</text>
					</div>
				</div>
				
				<div style="color: #666666;line-height: 50rpx;text-indent: 2em;">
					此健康码小程序仅供学习交流，小程序项目技术栈：uniapp、vue2、vuex、uView2.0组件库等。该项目包含小程序端、基于vue + element ui的后台管理系统前端、基于SpringBoot2的接口服务端。项目集成大数据展示页面，掌控区域疫情情况，希望疫情早点结束！
				</div>
			</div>
			
			<!-- 按钮区域 -->
			<div class="button-box" style="margin: 24rpx 0;">
				<u-button
					class="button-item"  type="primary"
					text="公共场所注册" @click="toPage('/pages/regPlace/regPlace?operType=reg')">
				</u-button>
				
				<u-button 
					class="button-item" type="primary"
					text="个人注册" @click="toPage('/pages/regUser/regUser')">
				</u-button>
			</div>
		</div>
		
		<!-- 底部信息 -->
		<PageFooter />
		
		<view>
			<u-loading-page :loading="loading" loading-text="loading..."></u-loading-page>
		</view>
	</view>
</template>

<script>
	import PageFooter from '@/components/layout/PageFooter.vue';
	import {hasLogin} from '@/utils/authUtils.js';
	
	export default {
		components: {
			PageFooter,
		},
		data() {
			return {
				loading: false,
			}
		},
		onLoad() {
			//判断是否已注册
			this.loading = true;
			// 检查是否已经登录
			if (hasLogin()) {
				// 已经登录，跳转至健康码首页
				// uni.redirectTo({
				uni.redirectTo({
					url: '/pages/healthCode/healthCode'
				});
			};
			
			this.loading = false;
		},
		methods: {
			toPage(url){
				uni.navigateTo({
					url: url
				});
			},
		}
	}
</script>

<style scoped>
	.content{
		/* 自定义导航栏默认44px */
		margin-top: 44px;
		padding: 24rpx;
	}
	
	.title{
		font-size: 42rpx; 
		font-weight: bold;
		text-align: center;
	}
	.sub-title{
		font-size: 36rpx; 
		text-align: center;
		margin-top: 24rpx;
	}
	.icon-box{
		text-align: center;
		margin-top: 24rpx;
		margin-bottom: 24rpx;
	}
	
	.button-box {
		padding: 24rpx;
	}
	.button-box .button-item{
		margin-bottom: 24rpx;
	}
</style>
